﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using Business = Savico.Library.Business;
using Entity = Savico.Library.Entity;

public partial class templates_admin_usercontrols_list_user : System.Web.UI.UserControl
{    
    Entity.ThanhVien entityListUser = new Entity.ThanhVien();
    Business.ThanhVien businessListUser = new Business.ThanhVien();
    DataTable dtListUser = new DataTable();
    public int stt = 1;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadListUser();
        }
    }
    //==================== Author: Mr.Thanh ==============================
    //==================== Email: ntthanh@vietstartech.com.vn ============
    //==================== Phone: 016.99.97.72.71 ========================

    //Ham LoadListUser (load tat ca thanh vien)
    //Giá trị truyền vào: không có
    //Giá trị trả về: DataTable
    protected void LoadListUser()
    {
        try
        {
            dtListUser = businessListUser.Select();
            if (dtListUser.Rows.Count > 0)
            {
                rptListUser.DataSource = dtListUser;
            }
            else
            {
                rptListUser.DataSource = null;
            }
            rptListUser.DataBind();
        }
        catch(Exception ex)
        {
            
        }
    }

    protected void btnThem_Click(object sender, EventArgs e)
    {
        Response.Redirect("Adduser.aspx");
    }
}
